
<div class="search">
  <label>Haku</label>
  <%form_tag(teams_url, {:method => :get}) do%>
    <%=text_field_tag  :query %>
    <%=submit_tag "Hae", :name => ''%>
  <%end%>
</div>
<div class="vista_toolbar">
  <ul>
    <%= toolbar_add 'joukkue', 'teams' %>
    <%= toolbar_delete_selected 'teams' %>
  </ul>
</div>
<%form_remote_tag :url=> destroy_selected_teams_url, :confirm => 'Haluatko varmasti poistaa joukkueet?', :before => "spinnerOn('teams');", :complete => "spinnerOff('teams');", :method => :delete, :html => {:id => 'teams_form'} do %>
  <table>
    <tr>
      <th>
        &nbsp;
      </th>
      <th>
        Joukkue
      </th>
      <th>
        &nbsp;
      </th>
    </tr>
    <%for team in @teams %>
      <tr>
        <td>
          <%=checkbox_delete_selected 'teams', team.id %>
        </td>
        <td>
          <%=link_to team.name, team_url(team) %>
        </td>
        <td>
          <%=icon_edit 'teams', team %>
        </td>
      </tr>
    <%end %>
  </table>
<% end %>

